package com.xlh.param.course;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xlh.util.InputValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

/**
 * 课程方向
 * <p>
 * Created by lx on 2019/12/25.
 */
@Data
public class DirectionParam {

    @ApiModelProperty(value = "专业方向id")
    private Long id;

    @ApiModelProperty(value = "专业方向名称")
    @NotBlank(message = "专业方向名称不能为空")
    @Length(max = 20, message = "专业方向名称不能超过20个字符")
    private String name;

    @JsonIgnore
    @ApiModelProperty(value = "序号")
    private Integer orderNum;

    public String getName() {
        return name == null ? null : InputValidator.regSpecialChar(name);
    }

}
